package com.fita.wechat.service;

import com.fita.entity.agent.Agent;
import com.fita.entity.wallet.UserWallet;

/**
 * @description:
 * @author: 11200
 * @date: 2019/7/1
 */
public interface UserWalletService extends DataService<UserWallet>{

    /**
     * 获取用户钱包，如果为空则创建
     * @param mobile
     * @return
     */
    UserWallet createOrLoadByMobile(String mobile);

    /**
     * 计算冻结代理分销奖励金额
     *
     * @param agent
     * @return
     */
    int calculateFreezeDistributionRewardAmount(Agent agent);

    /**
     * 提现
     *
     * @param id
     * @param amount
     */
    void withdraw(Long id, Integer amount);
}
